package com.xinhua;

import com.baomidou.mybatisplus.core.MybatisSqlSessionFactoryBuilder;
import com.xinhua.domain.User;
import com.xinhua.mapper.UserMapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;
import java.io.InputStream;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class pa2 {

    @Resource
    private UserMapper userMapper;

    @Test
    public void testfindall() {
        List<User> users = this.userMapper.selectList(null);
        for (User user:users) {
            System.out.println(user);
        }
    }

}
